<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page isELIgnored ="false"%>
<title>发布帖子</title>
<div class="page-container">
	<div class="container">
		<div class="row">

			<!-- start of page content -->
			<div class="span8 page-content">

				<article class="type-page hentry clearfix">
					<h1 class="post-title">
						<a href="#">发布帖子</a>
					</h1>
					<hr>
					<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit,
						sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
						aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud
						exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea
						commodo consequat.</p>
				</article>

<script type="text/javascript">
	// 初始化版本信息
	function initPlate(){
		$.ajax({
			url:"ajax/plate_all",
			method:"get",
			success:function(result){
				// 输出响应结果到控制台
				console.log(result);
				// 如果返回状态为true表示有数据返回,则显示数据到下拉类别框中
				if(result.state){
					// 获取JSON数组数据
					var datas = result.data;
					// 循环将数组中的版块数据动态添加到下拉列表框中
					for(var i = 0; i < datas.length; i++){
						// 获取版块数据
						var data = datas[i];
						$("#plate").append("<option value='"+data.plateId+"'>"+data.plateName+"</option>"); //为select追加一个Option(下拉项)
					}
				}else{
					// 如果返回状态为false表示没有版块数据
					$("#plate").prepend("<option value='0'>暂无版块</option>"); //为select插入一个Option(第一个位置)
				}
			}
		});
	}
	// 在页面加载时执行脚本去获取版块数据
	initPlate();
</script>

				<form id="contact-form" class="row" action="user_post_topic"
					method="POST">
					<div class="span2">
						<label for="plate">版块<span>*</span>
						</label>
					</div>
					<div class="span6">
						<select name="topic.plateId" id="plate" class="required input-xlarge" title="* Please provide your plate">
						</select>
					</div>
					
					<div class="span2">
						<label for="title">标题<span>*</span></label>
					</div>
					<div class="span6">
						<input type="text" name="topic.title" id="title"
							class="phone required input-xlarge" value=""
							title="* Please provide a valid title">
					</div>

					<div class="span2">
						<label for="tags">标签<span>*</span></label>
					</div>
					<div class="span6">
						<input type="text" name="topic.tags" id="tags"
							class="tags required input-xlarge" value=""
							title="* Please provide a valid tags">
					</div>

					<div class="span2">
						<label for="message">内容<span>*</span>
						</label>
					</div>
					<div class="span6">
						<textarea name="topic.content" id="content"
							class="required span6" rows="6"
							title="* Please enter your content"></textarea>
					</div>

					<div class="span6 offset2 bm30">
						<input type="submit" name="submit" value="Send"
							class="btn btn-inverse"> <img src="images/loading.gif"
							id="contact-loader" alt="Loading...">
					</div>

					<div class="span6 offset2 error-container"></div>
					<div class="span8 offset2" id="message-sent"></div>

				</form>
			</div>
			<!-- end of page content -->


			<!-- start of sidebar -->
			<aside class="span4 page-sidebar">

				<section class="widget">
					<div class="support-widget">
						<h3 class="title">支持</h3>
						<p class="intro">需要更多的支持吗？如果您没有找到答案，请与我们联系以获得进一步的帮助。</p>
					</div>
				</section>

				<section class="widget">
					<h3 class="title">最新文章</h3>
					<ul class="articles">
						<li class="article-entry standard">
							<h4>
								<a href="single.html">整合WordPress与您的网站</a>
							</h4> <span class="article-meta">25 Feb, 2013 in <a href="#"
								title="View all posts in Server &amp; Database">Server &amp;
									Database</a></span> <span class="like-count">66</span>
						</li>
						<li class="article-entry standard">
							<h4>
								<a href="single.html">网站维护</a>
							</h4> <span class="article-meta">24 Feb, 2013 in <a href="#"
								title="View all posts in Website Dev">Website Dev</a></span> <span
							class="like-count">15</span>
						</li>
						<li class="article-entry video">
							<h4>
								<a href="single.html">WordPress中的元标签</a>
							</h4> <span class="article-meta">23 Feb, 2013 in <a href="#"
								title="View all posts in Website Dev">Website Dev</a></span> <span
							class="like-count">8</span>
						</li>
						<li class="article-entry image">
							<h4>
								<a href="single.html">wordpress在你的语言</a>
							</h4> <span class="article-meta">22 Feb, 2013 in <a href="#"
								title="View all posts in Advanced Techniques">Advanced
									Techniques</a></span> <span class="like-count">6</span>
						</li>
					</ul>
				</section>


			</aside>
			<!-- end of sidebar -->
		</div>
	</div>
</div>
<!-- End of Page Container -->